package swap;

/*
 *  user:38917
 *  date:2025/5/5
 *  time:00:44
 */

public class Test {
    public static void swap(Value v1, Value v2) {
        int temp = v1.value;
        v1.value = v2.value;
        v2.value = temp;
    }
    public static void main(String[] args) {
        Value val1 = new Value();
        val1.value = 100;
        Value val2 = new Value();
        val2.value = 200;
        System.out.println("交换前: val1=" + val1.value + ", val2=" + val2.value);
        swap(val1, val2);
        System.out.println("交换后: val1=" + val1.value + ", val2=" + val2.value);
    }
}
